<?php namespace app\admin\validate;

use think\Validate;

/**
 * 用户管理登录验证器
 * Class User
 * @package app\admin\validate
 */
//手册验证->验证规则->属性定义
class User extends Validate
{
	//定义验证规则
	protected  $rule = [
		'username' => 'require',
		'password' => 'require',
		'code' => 'require|captcha',
	];
	//定义场景
	protected  $message = [
		'username.require' => '用户名不能为空',
		'password.require' => '密码不能为空',
		'code.require' => '验证码不能为空',
		'code.captcha' => '验证码错误'
	];
}
